import { Body, Controller, Get, Post, Query, Req } from '@nestjs/common';
import { CashBack_Service } from '../cashBack/cashBack.service';
import {
  CashBack_Create_Dto,
  CashBack_Find_Dto,
  CashBack_OrderListFind_Dto,
} from '../cashBack/assets/cashBack.dto';
import { ApiTags } from '@nestjs/swagger';
import { util_ApiResponse_Base } from '@/common/util/apiResponse';
import { util_Index_ReturnContent } from '@/common/util/index';
import { IRequest } from '@/common/typeScripts';

@Controller('/web/cashBackWeb')
@ApiTags('cashBackWeb 返现')
export class CashBackWeb_Controller {
  constructor(private readonly cashBack_Service: CashBack_Service) {}

  @Post('/submit')
  @util_ApiResponse_Base({
    dataType: 'dataType_string',
    description: '提交成功',
    summary: '提交提现',
  })
  async cashBack_Web_Submit(@Body() body: CashBack_Create_Dto, @Req() req: IRequest) {
    return util_Index_ReturnContent(await this.cashBack_Service.cashBack_Web_Submit(body, req));
  }

  @Get('/list')
  @util_ApiResponse_Base({
    dataType: 'dataType_list',
  })
  async cashBack_Web_FindByPage(@Query() query: CashBack_Find_Dto, @Req() req: IRequest) {
    return util_Index_ReturnContent(await this.cashBack_Service.cashBack_Web_FindByPage(query, req));
  }

  @Get('/orderList')
  @util_ApiResponse_Base({
    dataType: 'dataType_list',
  })
  async cashBack_FindOrderListByPage(@Query() query: CashBack_OrderListFind_Dto) {
    return util_Index_ReturnContent(await this.cashBack_Service.cashBack_FindOrderListByPage(query));
  }
}
